<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title></title>
    <script src="/plugin/jquery/jquery-1.9.0.min.js" type="text/javascript"></script>
    <link href="/plugin/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="/plugin/ligerUI/skins/Gray/css/all.css" rel="stylesheet"/>
    <link href="/css/form.css" rel="stylesheet"/>

    <script src="/plugin/ligerUI/js/core/base.js" type="text/javascript"></script>
    <script src="/plugin/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
</head>
<body>

<div style="margin-left: 5px;">
    <form id="subForm" th:if="${secRole!=null}" th:object="${secRole}">
        <div class="formDiv" style="width: 90%;">
            <div class="formLine">
                <input  type="hidden" name="deleted" value="0">
                <!--<input  type="hidden" name="orgId" value="">-->
                <div class="formInp">
                    <span>角色名称：</span>
                    <input class="blue testTxt" type="text" name="roleName" th:value="*{roleName}"/>
                </div>
                <div class="formInp">
                    <span>角色代码：</span>
                    <input class="blue testTxt" type="text" name="roleCode" th:value="*{roleCode}"/>
                </div>
            </div>
            <div class="formLine">
                <div class="btn">
                    <a href="javascript:;" onclick="sub();">保存数据</a>
                </div>
            </div>
        </div>
        <input name="id" type="hidden" th:value="*{id}" />
    </form>
</div>
</body>
<script type="text/javascript">
    function sub (){
        var data = $("#subForm").serialize();
        $.ajax({
            type: 'POST',
            url: 'update',
            data: data,
            dataType: 'json',
            success: function(data){
                $.ligerDialog.success('修改成功');
                parent.callBack();
            },
            error:function(){
                $.ligerDialog.error('修改失败');
            }
        });
    }
</script>
</html>